

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Edit Project</title>
    </head>
    <body>
        <div class="undernav">
            <span class="menuButton"><g:link class="create_project" action="create">New Project</g:link></span>
        </div>
        <div class="body">
            <h1>Edit Project</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${projectInstance}">
            <div class="errors">
                <g:renderErrors bean="${projectInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <input type="hidden" name="id" value="${projectInstance?.id}" />
                <input type="hidden" name="version" value="${projectInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="projectId">Project Id:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:projectInstance,field:'projectId','errors')}">
                                    <input type="text" id="projectId" name="projectId" value="${fieldValue(bean:projectInstance,field:'projectId')}"/>
                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name">Name:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:projectInstance,field:'name','errors')}">
                                    <input type="text" id="name" name="name" value="${fieldValue(bean:projectInstance,field:'name')}"/>
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="description">Description:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:projectInstance,field:'description','errors')}">
                                    <input type="text" id="description" name="description" value="${fieldValue(bean:projectInstance,field:'description')}"/>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="startDate">Start Date:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:projectInstance,field:'startDate','errors')}">
                                    <g:datePicker name="startDate" value="${projectInstance?.startDate}" precision="day" ></g:datePicker>
                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="endDate">End Date:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:projectInstance,field:'endDate','errors')}">
                                    <g:datePicker name="endDate" value="${projectInstance?.endDate}" precision="day" ></g:datePicker>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="lab">Lab:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:projectInstance,field:'lab','errors')}">
                                    <g:select optionKey="id" from="${Lab.list()}" name="lab.id" value="${projectInstance?.lab?.id}" ></g:select>
                                </td>
                            </tr>
                        <!--
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="budgets">Budgets:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:projectInstance,field:'budgets','errors')}">
                                    <g:select name="budgets"
from="${Budget.list()}"
size="5" multiple="yes" optionKey="id"
value="${projectInstance?.budgets}" />

                                </td>
                            </tr>
                        -->
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
                    <span class="button">
                      <g:link class="back" action="show" id="${projectInstance?.id}"> Go Back </g:link>
                    </span>
                </div>
            </g:form>
        </div>
    </body>
</html>
